You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make setDefaultKeyId just setAccountData and return, rather than listening for the value to come back down the sync. setAccountData already does that now, when it actually tries to change the value, and does not make an HTTP call if we try to set the account data value to the current value, which means that setDefaultKeyId would never get notified of the value being changed (since it doesn't get changed), and so would never return.
Checklist
Tests written for new code (and old code if feasible).
New or updated public/exported symbols have accurate TSDoc documentation.
setDefaultKeyId has had a listener on ClientEvent.AccountData to wait for the remote echo ever since 4S was introduced in #832. That was fine at that point, because MatrixClient.setAccountData didn't have any logic to filter out no-op changes, so there would reliably be a remote echo.
Later, #4695 changed MatrixClient.setAccountData so that (a) it did nothing if the change was a no-op; (b) it had its own listener on ClientEvent.AccountData to wait for the remote echo. [Aside: the comments added in that change also assert that there will be no remote echo in the case of a no-op change of account data; it is unclear to me now if that is accurate.] That change made the listener in setDefaultKeyId both redundant and unreliable (since in the case of changes that setAccountData deemed a no-op, there would be no remote echo).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #5474
Make
setDefaultKeyIdjustsetAccountDataand return, rather than listening for the value to come back down the sync.setAccountDataalready does that now, when it actually tries to change the value, and does not make an HTTP call if we try to set the account data value to the current value, which means thatsetDefaultKeyIdwould never get notified of the value being changed (since it doesn't get changed), and so would never return.Checklist
public/exportedsymbols have accurate TSDoc documentation.